<!DOCTYPE html>
<html lang="en">

<head>
  <meta charset="UTF-8">
  <meta http-equiv="X-UA-Compatible" content="IE=edge">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>你的资料</title>
  <link rel="stylesheet" href="layui/layui-v2.6.8/layui/css/layui.css">
  <link rel="stylesheet" href="css/bootstrap.min.css">
  <link rel="stylesheet" href="css/login.css">
</head>

<body style="background-image: url(jpg/165256Uidrc.jpg);">

  <fieldset class="layui-elem-field layui-field-title" style="margin-top: 30px;">
    <legend>你的资料</legend>
  </fieldset>

  <ul class="layui-nav" style="margin-bottom: 3rem;background:rgba(110, 108, 108, 0.5);">
    <li class="layui-nav-item"><a href="">导航</a></li>
    <li class="layui-nav-item">
      <button class="layui-btn demo1"style="margin-bottom: 3rem;background:rgba(110, 108, 108, 0.5);">
        操作
        <i class="layui-icon layui-icon-down layui-font-12"></i>
      </button>
    </li>
  </ul>

  <div class="card"
  style="width: 50rem;margin: auto; margin-top: 10rem;height: 28rem;background: rgba(156, 152, 152, 0.5)">
  <form  id="loginForm" style="background: rgba(156, 152, 152, 0.5);">
    <div class="form-group">
        <label for="">你的用户名是</label>
               {{username}}
    </div>
</form>
</div>
</div>
  <script src="js/jquery-3.6.0.min.js"></script>
  <script src="layui/layui-v2.6.8/layui/layui.js"></script>
  <script src="https://cdn.bootcss.com/axios/0.18.0/axios.min.js"></script>
  <script>
    function logout() {
      axios({
        method: 'post',
        url: '/logout'
      }).then(function (response) {
        let res = response.data;
        if (res.code === 200) {
          window.location.href = '/login';
        }
      }).catch((err) => {

      });
    }
  </script>
  <script>
    layui.use(['dropdown', 'util', 'layer', 'table'], function () {
      var dropdown = layui.dropdown
        , util = layui.util
        , layer = layui.layer
        , table = layui.table
        , $ = layui.jquery;

      //初演示
      dropdown.render({
        elem: '.demo1'
        , data: [{
          title: '更改密码'
          , id: 100
        }, {
          title: '返回'
          , id: 101
        }, {
          title: '注销'
          , id: 102
        }]
        , click: function (obj) {
          if (obj.title == '更改密码') {
            window.location.href='/updatePassword'
          }
          else if (obj.title == '返回') {
            window.location.href = '/'
          }
          else {
            logout();
          }
        }
      })
    });
  </script>
  <script>
    function logout() {
      axios({
        method: 'post',
        url: '/logout'
      }).then(function (response) {
        let res = response.data;
        if (res.code === 200) {
          window.location.href = '/login';
        }
      }).catch((err) => {

      });
    }
  </script>
</body>

</html>